import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import render from '@dfeidao/atom-mobile/render/render';
import get_storage from '@dfeidao/atom-mobile/storage/get';
import set_storage from '@dfeidao/atom-mobile/storage/set';

interface Iarr {
	id: number;
	text: string;
	show: boolean;
}
export default async function a002(fd: IFeidaoAiMobile) {
	fd.page.props.navigation.addListener('didFocus', async () => {
		const arr: Iarr[] = JSON.parse(await get_storage('arr') || '[]');
		console.log('1111111', arr);
		set_storage('arr', JSON.stringify(arr));
		arr.forEach((item) => {
			item.show = false;
		});
		render(fd, { arr, fd });
	});
}
